VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 2 of 2
  1. Member
    Join Date
    Mar 2011
    Location
    Paris, France
    Search PM
    Hello,

    I'm trying to turn a Windows batch file using the youtube-dlp.exe binary to a Python script. They're such a pain over there in the issues section that I'd rather ask elsewhere.

    Although I kept the "ext:mp4" bit, for some reason, the following script downloads the file as .webm instead of .mp4.

    Any idea why?

    Thank you.

    Code:
    import yt_dlp
    
    yt_opts = { 'extractor-args': 'youtube:lang=fr', 'S':'width:640,ext:mp4,lang:fr-FR', 
    'trim-filenames':'128',
    'compat':'filename-sanitization',
    'console-title':'',
    'progress':'',
    'progress-template':'%(progress._percent_str)s',
    }
    
    with yt_dlp.YoutubeDL(yt_opts) as ydl:
        ydl.download("https://www.youtube.com/watch?v=fHT2CtiEAhM")
    Quote Quote  
  2. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by yetanotherlogin View Post
    Hello,

    I'm trying to turn a Windows batch file using the youtube-dlp.exe binary to a Python script. They're such a pain over there in the issues section that I'd rather ask elsewhere.

    Although I kept the "ext:mp4" bit, for some reason, the following script downloads the file as .webm instead of .mp4.

    Any idea why?

    Thank you.

    Code:
    import yt_dlp
    
    yt_opts = { 'extractor-args': 'youtube:lang=fr', 'S':'width:640,ext:mp4,lang:fr-FR', 
    'trim-filenames':'128',
    'compat':'filename-sanitization',
    'console-title':'',
    'progress':'',
    'progress-template':'%(progress._percent_str)s',
    }
    
    with yt_dlp.YoutubeDL(yt_opts) as ydl:
        ydl.download("https://www.youtube.com/watch?v=fHT2CtiEAhM")
    Don't know about Python.. and I'm not sure if this is the YT_DLP you're talking : https://github.com/yt-dlp/yt-dlp

    To download a video in a specific format using the command-line in YT-DLP you need to use the --format parameter (also -f ).. in your case YT_DLP.exe --format mp4 <url of the video>
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!